Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Play with workflows #41

Closed
wants to merge 17 commits into from
Closed

[WIP] Play with workflows #41

wants to merge 17 commits into from

Conversation

nkuba
Copy link
Member

@nkuba nkuba commented Nov 22, 2023

No description provided.

r-czajkowski and others added 17 commits November 14, 2023 12:27
Only one file can be set per repo, so it should be in the root dir.
Set up global linting config for the entire monorepo.
Since we configured the linting config for the entire monorepo there is
no need to keep linting per package. We want to override some config for
`core` package so we add the `.eslintrc` file to set custom rule for
this package.

Here we temporarily switch off pre-commit config - we are going to
address it in follow-up work.
Add commit hash that fixes the linting warning.
Add a script that formats code for a given workspace based on the global
linting configuration. Available command line arguments:
- `--workspace` or `-w`: defines the workspace name eg. core for which
  the code formatting will be invoked. This argument is required,
- `--type` or `-t`: Determines the file type. If not defined all
  supported types will be formatted,
- `--fix` or `-f`: should automatically fix linting errors.

We want to run linting in pre-commit hook but only for those pacakges
where changes are taking place. Eg. when working on `website` the
pre-commit hook should only be invoked for this workspace not for the
others. This script allows us to run linting for different file types:
js/ts, sol and config files and, only for a given workspace.
We should run the `lint.sh` scirpt for linting to hanlde correct
workspace. Note that to run this script you must add executable
permissions: `chmod +x lint.sh`.
We can configure a workflow to run based on the what file paths are
changed. Here we add `paths` filter under the `pull_request` event to
run the `core` workflow only when changes happen in `./core` dir.
Because in this script we use bash features, the first line of the file
must be `#!/bin/bash`. Otherwise GH actions won't run this script as
`bash` and it will fail once problematic line is reached.
Here we add `format` and `format:fix` scripts to the root package.json
file. We are going to run `format` script in the GH workflows and it
will check code format for all supported types in a given workspace.
Check if the code is correctly formatted in `core` workspace based on
the global linting configuration.
This is an initial implementation of the CI process to check formatting
in `website` workspace.
@nkuba nkuba closed this Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants